package cn.jbolt.wechat.common.mp;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;

import java.util.Map;

public class WechatMpMessageHandler implements WxMpMessageHandler {


    private DefaultWechatMpMessageHandler handler;

    public WechatMpMessageHandler(DefaultWechatMpMessageHandler handler) {
        this.handler = handler;
    }

    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map<String, Object> map, WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException {

        return handler.handle(wxMpXmlMessage);
    }
}
